package com.example.designpatterns.structural.bridge;

/**
 * 抽象部分
 * 数据库连接管理类
 *
 * @author scott
 */
public class DatabaseConnector {

    private DatabaseDriver driver;

    public DatabaseConnector(DatabaseDriver driver) {
        this.driver = driver;
    }

    public void connectToDatabase(String url, String username, String password) {
        driver.connect(url, username, password);
    }

    public void executeQuery(String sql) {
        driver.query(sql);
    }

    public void executeStatement(String sql) {
        driver.execute(sql);
    }

}
